package org.micode.demo.web.service;

import org.micode.common.domain.DataPage;
import org.micode.common.domain.vo.EditObjVO;
import org.micode.common.domain.vo.KeyVO;
import org.micode.demo.db.domain.dto.SysUserRoleDTO;
import org.micode.demo.db.domain.query.SysUserRoleQuery;
import org.micode.demo.db.service.DaoSysUserRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户所属角色(sys_user_role) 的APP服务实现类
 *
 * author: wutianbin
 */
@Service
@Slf4j
public class SysUserRoleService {

    @Autowired
    private DaoSysUserRoleService daoSysUserRoleService;

    public DataPage<SysUserRoleDTO> list(SysUserRoleQuery dataQuery) {
        return daoSysUserRoleService.listPage(dataQuery);
    }

    public SysUserRoleDTO info(KeyVO<Long> id) {
        return daoSysUserRoleService.get(id.getKey());
    }

    public SysUserRoleDTO insert(SysUserRoleDTO sysUserRole) {
        return daoSysUserRoleService.insert(sysUserRole);
    }

    public Integer update(SysUserRoleDTO sysUserRole) {
        return daoSysUserRoleService.update(sysUserRole);
    }

    public Integer delete(EditObjVO<List<Long>> delIds) {
        return daoSysUserRoleService.deleteByKeys(delIds);
    }

}
